package type.person;

/**
 * @Date 2021/5/5 10:19 上午
 * @Author dengxin
 */
public class Position {

    private String title;
    private Person person;

    public Position(String title, Person newEmployee) {
        this.title = title;
        this.person = newEmployee;
        if (person == null) {
            person = Person.NULL;
        }
    }

    public Position(String title) {
        this.title = title;
        this.person = Person.NULL;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Person getPerson() {
        return person;
    }

    public void setPerson(Person person) {
        this.person = person;
        if (this.person == null) {
            this.person = Person.NULL;
        }
    }

    @Override
    public String toString() {
        return "Position: " + this.title + ", " +this.person;
    }
}
